package com.intellif.spring_boot_autoconfiguration.bootstrap;

import com.intellif.spring_boot_autoconfiguration.repository.ComponentBean;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = "com.intellif.spring_boot_autoconfiguration.repository")
public class StartAnnotation {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(StartAnnotation.class).
                web(WebApplicationType.NONE).
                run(args);
        ComponentBean bean = applicationContext.getBean("componentBean",ComponentBean.class);
        System.out.println(bean);
        applicationContext.close();

    }
}
